<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button id="btn">更改</button>
  <div id="app1">
    app1
  </div>
  <div id="app2">
    app2
  </div>
  <script>
    const btn = document.querySelector('#btn')

    const app1 = document.querySelector('#app1')
    const app2 = document.querySelector('#app2')
   
    btn.onclick = () => {
      app1.innerHTML = 'hello app1'
      app2.innerHTML = 'hello app1'
    }

   
    app1.innerHTML = 'hello app1'
    app2.innerHTML = 'hello app1'
    
    alert(1)
  </script>
</body>
</html>